import Vue from 'vue'
import VueRouter from 'vue-router'

// 模块组件
import article from '@/views/article'
import dashboard from '@/views/dashboard'
import layout from '@/views/layout'
import login from '@/views/login'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: login },

  {
    path: '/',
    component: layout,
    redirct: '/layout',
    children: [
      { path: '/article', component: article },
      { path: '/dashboard', component: dashboard }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
